use std::fmt::Display;
#[derive(Debug)]
struct Pair<T> {
    x: T,
    y: T,
}
impl<T> Pair<T> {
    fn new(x: T, y: T) -> Self {
        Self {
            x,
            y,
        }
    }
}

impl<T: Display + PartialOrd> Pair<T> {
    fn cmp_display(&self) {
        if self.x >= self.y {
            println!("The largest member is x = {}", self.x);
        } else {
            println!("The largest member is y = {}", self.y);
        }
    }
}

fn main() {
    let  p1 = Pair::new(1, 3);
    p1.cmp_display();
    let  p2 = Pair::new(3.00f32, 2.00);
    p2.cmp_display();
}
